package com.cqc.jdk8.Jio.writer;

import org.junit.Test;

import java.io.BufferedWriter;
import java.io.PrintWriter;

public class BufferedWriterTest {



    @Test
    public void f1() throws Exception {
        String filename = "C:\\Users\\cui\\Desktop\\1.txt";
        BufferedWriter writer = new BufferedWriter(new PrintWriter(filename, "utf-8"));
        writer.append("姓名,年龄,班级")
                .append(System.lineSeparator())
                .append("张三,15,一班")
                .append(System.lineSeparator())
                .append("李四,16,二班")
                .flush();
        writer.close();
    }
}
